package 比赛.chuanZhiMoNi;

import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int max = 0;
        while (str.contains(getSubStr(max))){
            max ++;
        }
        System.out.println(max - 1);
    }

    public static String getSubStr(int max){
        String res = "";
        while (max!=0){
            res += 'R';
            max --;
        }
        return  res;
    }
}
